

#include "common.hpp"
#include "transfer.hpp"
#include "net.hpp"
#include "items.hpp"


// in common export global const


///////////////////
// Global values //
///////////////////

// Messy constant
const int messy_concurrency_fixup = 9000; /* wait time in usec */

// Size scale
#define SC(VAL) (VAL * scale_fact)
const int scale_fact = 1;

// Constants
const int main_window_width = SC( 385 );
const int main_window_height = SC( 424 );
const int main_widgets_width = SC( 340 );
const int main_widgets_xoffset = SC( 15 );

const int general_widget_height = SC( 15 );
const int general_widget_buffer = SC( 5 );

const int general_textbox_height = SC( 21 );
const int general_button_height = SC( 21 );

const int general_checkbutton_edge = SC( 13 );

const char *tmp_dir = "/tmp/ubench";
const char *log_dir = "/var/log/ubench";


/////////////////////
// Class constants //
/////////////////////

// Utilization bars
const int UsageBar::label_width = SC( 30 );
const int UsageBar::usg_bar_height = SC( 25 );

const int CPUusage::update_interval = 1000;
const char * CPUusage::cpu_proc = "/proc/stat";
const int MEMusage::update_interval = 1000;
const char * MEMusage::mem_proc = "/proc/meminfo";

// GuiConnector
const int GuiConnector::gui_connector_overall_height = SC ( 230 );
const int GuiConnector::gui_connector_height = SC( 110);
const int ConnectorPanel::connector_panel_width = SC( 100 );
const int GuiConnector::destination_panel_offsetx =
	ConnectorPanel::connector_panel_width + general_widget_buffer * 2;
const int GuiConnector::gauge_control_height = 30;
const int GuiConnector::connect_panels_offsety = gui_connector_height + 2 * general_widget_buffer;
const int GuiConnector::rate_label_offsety = connect_panels_offsety + 30 + 4 * general_widget_buffer;
const int GuiConnector::gauge_control_offsety = rate_label_offsety + 30 + 2 * general_widget_buffer;

const int ConnectorPanel::content_offsetx = SC( 6 );
const int GuiConnector::update_interval = 1000;
const char *SettingsPanel::establ_caption = "Establish";
const char *SettingsPanel::cancel_caption = "Cancel";

const int GuiConnector::status_query_interval = 5 * 1000; // 5 sec

// Connector
const int Connector::max_chunk_size = 66000;
const int Connector::max_delay_time = 1000;
const int Connector::default_chunk_size = 1000; // bytes
const int Connector::connection_timeout = 20 * 1000; // 20 sec

// Gauges
const int Gauge::gauge_update_interval = 1000;
const long FileGauge::max_file_size = 1000000000;

// General
const std::string ErrorReporter::prfx[] = {"FATAL", "ERROR"};

// TCP/IP
const int TCPsource::backlog = 1;
const int TCPIPnetworking::max_mtu = 1500;
